<?php
/*
* Copyright (c) 2010 by Cediti
*
* You may distribute under the terms of either the GNU Lesser General
* Public License or the new BSD License, as specified in the README file.
*/
// created :	31 March 2010
// version :	31 March 2010

class Cmis_Request_Rest implements Cmis_Request_Interface
{
	/**
	 * @var Cmis_Http_Adapter
	 */
	protected $_http;

	/**
     * Constructor, login and password value depending on the auth type
     * @param string $login
     * @param string $password
     * @param const $auth_type
     * @param string $http_vendor type of http request, by default Curl
     * @see Cmis_Request_Interface#__construct()
	 */
	public function __construct($login, $password, $auth_type = self::AUTH_HTTP_BASIC, $secure = false)
	{
		$http_vendor = (func_num_args() > 4)?func_get_arg(4):'Curl';

		$this->_http = Cmis_Http_Adapter::factory($http_vendor, $secure);
		$this->getClient()->setAuth($login, $password, $auth_type);
	}

	/**
	 * @return Cmis_Http_Adapter
	 */
	public function getClient()
	{
		return $this->_http;
	}
}

# EOF
